package ipdesk.common;

import java.util.HashMap;
import java.util.Map;

public class Codes
{
	private static Codes singleton;
	
	Map<String, String> CONSULT_TYPE_CODES = new HashMap<String, String>();
	
	Map<String, String> CONSULT_SUB_TYPE_CODES = new HashMap<String, String>();
	
	Map<String, String> IPR_CODES = new HashMap<String, String>();
	
	Map<String, String> CONSULTING_CATEGORY_CODES = new HashMap<String, String>();
	
	Map<String, String> CONSULTING_WAY_CODES = new HashMap<String, String>();
	
	Map<String, String> DESK_CODES = new HashMap<String, String>();
	
	Map<String, String> LOCAL_DIVISION_CODES = new HashMap<String, String>();
	
	Map<String, String> HEAD_SIZE_CODES = new HashMap<String, String>();
	
	Map<String, String> CONSULTING_CODES = new HashMap<String, String>();
	
	Map<String, String> EXCLUSIVE_FLAG_CODES = new HashMap<String, String>();
	
	public static Codes getInstance()
	{
		if(singleton == null)
		{
			singleton = new Codes();
		}
		
		return singleton;
	}
	
	/**
	 * 상담분야 1의 코드에 대한 값을 반환한다.
	 * @param consultTypeCode
	 * @return
	 */
	public String getFromConsultingTypeCodeToValue(String consultTypeCode)
	{
		CONSULT_TYPE_CODES.put("TOC01", "권리확보");
		CONSULT_TYPE_CODES.put("TOC02", "침해대응");
		CONSULT_TYPE_CODES.put("TOC03", "기타");
		CONSULT_TYPE_CODES.put("TOC04", "침해대응");
		
		String consultType = "";
		
		if(consultTypeCode != null)
		{
			consultType =  CONSULT_TYPE_CODES.get(consultTypeCode);
		}
		
		return consultType;
	}
	
	
	/**
	 * 상담분야 1의 코드를 심플 코드로 반환한다.
	 * @param consultTypeCode
	 * @return
	 */
	public String getFromConsultingTypeCodeToSimpleCode(String consultTypeCode)
	{
		CONSULT_TYPE_CODES.put("TOC01", "1");
		CONSULT_TYPE_CODES.put("TOC02", "2");
		CONSULT_TYPE_CODES.put("TOC03", "3");
		CONSULT_TYPE_CODES.put("TOC04", "4");
		
		String consultType = "";
		
		if(consultTypeCode != null)
		{
			consultType =  CONSULT_TYPE_CODES.get(consultTypeCode);
		}
		
		return consultType;
	}
	
	/**
	 * 상담분야 1의 심플코드의 원래 코드를 반환한다.
	 * @param consultTypeCode
	 * @return
	 */
	public String getFromSimpleCodeToConsultingTypeCode(String consultTypeCode)
	{
		CONSULT_TYPE_CODES.put("1", "TOC01");
		CONSULT_TYPE_CODES.put("2", "TOC02");
		CONSULT_TYPE_CODES.put("3", "TOC03");
		CONSULT_TYPE_CODES.put("4", "TOC04");
		
		String consultType = "";
		
		if(consultTypeCode != null)
		{
			consultType =  CONSULT_TYPE_CODES.get(consultTypeCode);
		}
		
		return consultType;
	}
	
	/**
	 * 침해대응 하위의 침해유형의 코드에 대한 값을 반환한다.
	 * @param consultTypeCode
	 * @return
	 */
	public String getFromConsultingSubTypeCodeToValue(String consultSubTypeCode)
	{
		/*CONSULT_SUB_TYPE_CODES.put("TOC0201", "현지인의 무단선등록");
		CONSULT_SUB_TYPE_CODES.put("TOC0202", "미등록된 권리에대한 모조품유통");
		CONSULT_SUB_TYPE_CODES.put("TOC0203", "등록된 권리에대한 모조품유통");
		CONSULT_SUB_TYPE_CODES.put("TOC0204", "기타");*/
		
		CONSULT_SUB_TYPE_CODES.put("TOC0101", "출원 관련");
		CONSULT_SUB_TYPE_CODES.put("TOC0102", "등록 관련");
		CONSULT_SUB_TYPE_CODES.put("TOC0103", "기타");
		
		CONSULT_SUB_TYPE_CODES.put("TOC0201", "침해");
		CONSULT_SUB_TYPE_CODES.put("TOC0202", "피침해");
		CONSULT_SUB_TYPE_CODES.put("TOC0203", "무단선등록");
		CONSULT_SUB_TYPE_CODES.put("TOC0204", "기타");
		
		CONSULT_SUB_TYPE_CODES.put("TOC0301", "사업안내");
		CONSULT_SUB_TYPE_CODES.put("TOC0302", "저작권");
		CONSULT_SUB_TYPE_CODES.put("TOC0303", "기타");
		
		CONSULT_SUB_TYPE_CODES.put("TOC0401", "현지인의 무단 선등록");
		CONSULT_SUB_TYPE_CODES.put("TOC0402", "미등록된 권리에대한 모조품 유통");
		CONSULT_SUB_TYPE_CODES.put("TOC0403", "등록된 권리에대한 모조품 유통");
		CONSULT_SUB_TYPE_CODES.put("TOC0404", "기타");
		
		String consultSubType = "";
		
		if(consultSubTypeCode != null)
		{
			consultSubType =  CONSULT_SUB_TYPE_CODES.get(consultSubTypeCode);
		}
		
		return consultSubType;
	}
	
	/**
	 *  침해대응 하위 침해유형의 심플코드의 원래 코드를 반환한다.
	 * @param consultTypeCode
	 * @return
	 */
	public String getFromSimpleCodeToConsultingSubTypeCode(String consultSubTypeCode)
	{
		CONSULT_SUB_TYPE_CODES.put("1", "TOC0101");
		CONSULT_SUB_TYPE_CODES.put("2", "TOC0102");
		CONSULT_SUB_TYPE_CODES.put("3", "TOC0103");
		
		CONSULT_SUB_TYPE_CODES.put("4", "TOC0201");
		CONSULT_SUB_TYPE_CODES.put("5", "TOC0202");
		CONSULT_SUB_TYPE_CODES.put("6", "TOC0203");
		CONSULT_SUB_TYPE_CODES.put("7", "TOC0204");
		
		CONSULT_SUB_TYPE_CODES.put("8", "TOC0301");
		CONSULT_SUB_TYPE_CODES.put("9", "TOC0302");
		CONSULT_SUB_TYPE_CODES.put("10", "TOC0303");
		
		CONSULT_SUB_TYPE_CODES.put("11", "TOC0401");
		CONSULT_SUB_TYPE_CODES.put("12", "TOC0402");
		CONSULT_SUB_TYPE_CODES.put("13", "TOC0403");
		CONSULT_SUB_TYPE_CODES.put("14", "TOC0404");
		
		String consultSubType = "";
		
		if(consultSubTypeCode != null)
		{
			consultSubType =  CONSULT_SUB_TYPE_CODES.get(consultSubTypeCode);
		}
		
		return consultSubType;
	}
	
	/**
	 * 침해대응 하위의 침해유형의 코드를 심플 코드로 반환한다.
	 * @param consultTypeCode
	 * @return
	 */
	public String getFromConsultingSubTypeCodeToSimpleCode(String consultSubTypeCode)
	{
		CONSULT_SUB_TYPE_CODES.put("TOC0101", "1");
		CONSULT_SUB_TYPE_CODES.put("TOC0102", "2");
		CONSULT_SUB_TYPE_CODES.put("TOC0103", "3");
		
		CONSULT_SUB_TYPE_CODES.put("TOC0201", "4");
		CONSULT_SUB_TYPE_CODES.put("TOC0202", "5");
		CONSULT_SUB_TYPE_CODES.put("TOC0203", "6");
		CONSULT_SUB_TYPE_CODES.put("TOC0204", "7");
		
		CONSULT_SUB_TYPE_CODES.put("TOC0301", "8");
		CONSULT_SUB_TYPE_CODES.put("TOC0302", "9");
		CONSULT_SUB_TYPE_CODES.put("TOC0303", "10");
		
		CONSULT_SUB_TYPE_CODES.put("TOC0401", "11");
		CONSULT_SUB_TYPE_CODES.put("TOC0402", "12");
		CONSULT_SUB_TYPE_CODES.put("TOC0403", "13");
		CONSULT_SUB_TYPE_CODES.put("TOC0404", "14");
		
		String consultSubType = "";
		
		if(consultSubTypeCode != null)
		{
			consultSubType =  CONSULT_SUB_TYPE_CODES.get(consultSubTypeCode);
		}
		
		return consultSubType;
	}
	
	/**
	 * 상담분야 2의 코드에 대한 값을 반환한다.
	 * @param consultTypeCode
	 * @return
	 */
	public String getFromIprCodeToValue(String iprCode)
	{
		IPR_CODES.put("IPR10", "특허");
		IPR_CODES.put("IPR20", "실용신안");
		IPR_CODES.put("IPR30", "디자인");
		IPR_CODES.put("IPR40", "상표");
		IPR_CODES.put("IPR99", "기타");
		
		String iprCodeValue = "";
		
		if(iprCode != null)
		{
			iprCodeValue =  IPR_CODES.get(iprCode);
		}
		
		return iprCodeValue;
	}
	
	/**
	 * 상담분야 2 코드의 심플 코드를 반환한다.
	 * @param consultTypeCode
	 * @return
	 */
	public String getFromIprCodeToSimpleCode(String iprCode)
	{
		IPR_CODES.put("IPR10", "1");
		IPR_CODES.put("IPR20", "2");
		IPR_CODES.put("IPR30", "3");
		IPR_CODES.put("IPR40", "4");
		IPR_CODES.put("IPR99", "5");
		
		String iprCodeValue = "";
		
		if(iprCode != null)
		{
			iprCodeValue =  IPR_CODES.get(iprCode);
		}
		
		return iprCodeValue;
	}
	
	/**
	 * 상담분야 2 심플코드의 원래 코드를 반환한다.
	 * @param consultTypeCode
	 * @return
	 */
	public String getFromSimpleCodeToIprCode(String iprCode)
	{
		IPR_CODES.put("1", "IPR10");
		IPR_CODES.put("2", "IPR20");
		IPR_CODES.put("3", "IPR30");
		IPR_CODES.put("4", "IPR40");
		IPR_CODES.put("5", "IPR99");
		
		String iprCodeValue = "";
		
		if(iprCode != null)
		{
			iprCodeValue =  IPR_CODES.get(iprCode);
		}
		
		return iprCodeValue;
	}
	
	/**
	 * 상담종류의 코드에 대한 값을 반환한다.
	 * @param consultingCategory
	 * @return
	 */
	public String getFromConsultingCategoryToValue(String consultingCategory)
	{
		CONSULTING_CATEGORY_CODES.put("CSC01", "전문가상담");
		CONSULTING_CATEGORY_CODES.put("CSC02", "일반상담");
		
		String category = "";
		
		if(consultingCategory != null) {
			category = CONSULTING_CATEGORY_CODES.get(consultingCategory);
		}
		
		return category;
	}
	
	/**
	 * 상담종류의 코드에 대한 심플코드를 반환한다.
	 * 
	 * @param consultingCategory
	 * @return
	 */
	public String getFromConsultingCategoryToSimpleCode(String consultingCategory)
	{
		CONSULTING_CATEGORY_CODES.put("CSC01", "1");
		CONSULTING_CATEGORY_CODES.put("CSC02", "2");
		
		String category = "";
		
		if(consultingCategory != null)
		{
			category =  CONSULTING_CATEGORY_CODES.get(consultingCategory);
		}
		
		return category;
	}
	
	/**
	 * 상담종류의 심플코드에 대한 원래 코드를 반환한다.
	 * 
	 * @param consultingCategory
	 * @return
	 */
	public String getFromSimpleCodeToConsultingCategorye(String consultingCategory)
	{
		CONSULTING_CATEGORY_CODES.put("1", "CSC01");
		CONSULTING_CATEGORY_CODES.put("2", "CSC02");
		
		String category = "";
		
		if(consultingCategory != null)
		{
			category =  CONSULTING_CATEGORY_CODES.get(consultingCategory);
		}
		
		return category;
	}
	
	/**
	 * 상담방법의 코드에 대한 값을 반환한다.
	 * 
	 * @param consultingWayCode
	 * @return
	 */
	public String getFromConsultingWayCodeToValue(String consultingWayCode)
	{
		CONSULTING_WAY_CODES.put("WOC01", "전화상담");
		CONSULTING_WAY_CODES.put("WOC02", "메일상담");
		CONSULTING_WAY_CODES.put("WOC03", "내방상담");
		CONSULTING_WAY_CODES.put("WOC04", "출장상담");
		CONSULTING_WAY_CODES.put("WOC05", "기타");
		
		String consultingWay = "";
		
		if(consultingWayCode != null)
		{
			consultingWay =  CONSULTING_WAY_CODES.get(consultingWayCode);
		}
		
		return consultingWay;
	}
	
	
	/**
	 * 상담방법의 코드에 대한 심플코드를 반환한다.
	 * 
	 * @param consultingWayCode
	 * @return
	 */
	public String getFromConsultingWayCodeToSimpleCode(String consultingWayCode)
	{
		CONSULTING_WAY_CODES.put("WOC01", "1");
		CONSULTING_WAY_CODES.put("WOC02", "2");
		CONSULTING_WAY_CODES.put("WOC03", "3");
		CONSULTING_WAY_CODES.put("WOC04", "4");
		CONSULTING_WAY_CODES.put("WOC05", "5");
		
		String consultingWay = "";
		
		if(consultingWayCode != null)
		{
			consultingWay =  CONSULTING_WAY_CODES.get(consultingWayCode);
		}
		
		return consultingWay;
	}
	
	/**
	 * 상담방법의 심플코드에 대한 원래 코드를 반환한다.
	 * 
	 * @param consultingWayCode
	 * @return
	 */
	public String getFromSimpleCodeToConsultingWayCode(String consultingWayCode)
	{
		CONSULTING_WAY_CODES.put("1", "WOC01");
		CONSULTING_WAY_CODES.put("2", "WOC02");
		CONSULTING_WAY_CODES.put("3", "WOC03");
		CONSULTING_WAY_CODES.put("4", "WOC04");
		CONSULTING_WAY_CODES.put("5", "WOC05");
		
		String consultingWay = "";
		
		if(consultingWayCode != null)
		{
			consultingWay =  CONSULTING_WAY_CODES.get(consultingWayCode);
		}
		
		return consultingWay;
	}
	
	/**
	 * 센터 코드에 대한 값을 반환한다.
	 * 
	 * @param consultingWayCode
	 * @return
	 */
	public String getDeskCode(String deskCode)
	{
		DESK_CODES.put("total", "전체");
		DESK_CODES.put("DESK101", "베이징");
		DESK_CODES.put("DESK102", "상하이");
		DESK_CODES.put("DESK103", "광저우");
		DESK_CODES.put("DESK104", "청도");
		DESK_CODES.put("DESK105", "심양");
		DESK_CODES.put("DESK106", "방콕");
		DESK_CODES.put("DESK107", "하노이");
		DESK_CODES.put("DESK108", "호치민");
		DESK_CODES.put("DESK109", "워싱턴");
		DESK_CODES.put("DESK110", "자카르타");
		DESK_CODES.put("DESK111", "로스앤젤레스");
		DESK_CODES.put("DESK112", "KIPRA 본사");
		DESK_CODES.put("DESK113", "KOTRA 본사");
		DESK_CODES.put("DESK114", "뉴욕");
		
		
		String deskCodeValue = "";
		
		if(deskCode != null)
		{
			deskCodeValue =  DESK_CODES.get(deskCode);
		}
		
		return deskCodeValue;
	}
	
	
	/**
	 * 현지 기업의 구분에 대한 값을 반환한다.
	 * 
	 * @param consultingWayCode
	 * @return
	 */
	public String getLocalDivisionCode(String localDivisionCode)
	{
		LOCAL_DIVISION_CODES.put("LCL01", "개인출자");
		LOCAL_DIVISION_CODES.put("LCL02", "독자출자");
		LOCAL_DIVISION_CODES.put("LCL03", "합자출자");
		LOCAL_DIVISION_CODES.put("LCL04", "출자예정");
		LOCAL_DIVISION_CODES.put("LCL05", "본사");
		LOCAL_DIVISION_CODES.put("LCL06", "지사");
		LOCAL_DIVISION_CODES.put("LCL07", "기타");
		
		
		String localDivisionCodeValue = "";
		
		if(localDivisionCode != null)
		{
			localDivisionCodeValue =  LOCAL_DIVISION_CODES.get(localDivisionCode);
		}
		
		return localDivisionCodeValue;
	}
	
	/**
	 * 현지기업 코드의 심플 코드를 반환한다.
	 * @param consultTypeCode
	 * @return
	 */
	public String getFromLocalDivisionCodeToSimpleCode(String localDivisionCode)
	{
		LOCAL_DIVISION_CODES.put("LCL01", "1");
		LOCAL_DIVISION_CODES.put("LCL02", "2");
		LOCAL_DIVISION_CODES.put("LCL03", "3");
		LOCAL_DIVISION_CODES.put("LCL04", "4");
		LOCAL_DIVISION_CODES.put("LCL05", "5");
		LOCAL_DIVISION_CODES.put("LCL06", "6");
		LOCAL_DIVISION_CODES.put("LCL07", "7");
		
		String localDivisionCodeValue = "";
		
		if(localDivisionCode != null)
		{
			localDivisionCodeValue =  LOCAL_DIVISION_CODES.get(localDivisionCode);
		}
		
		return localDivisionCodeValue;
	}
	
	/**
	 * 현지기업 코드의 심플 코드를 반환한다.
	 * @param consultTypeCode
	 * @return
	 */
	public String getFromSimpleCodeToLocalDivisionCode(String localDivisionCode)
	{
		LOCAL_DIVISION_CODES.put("1", "LCL01");
		LOCAL_DIVISION_CODES.put("2", "LCL02");
		LOCAL_DIVISION_CODES.put("3", "LCL03");
		LOCAL_DIVISION_CODES.put("4", "LCL04");
		LOCAL_DIVISION_CODES.put("5", "LCL05");
		LOCAL_DIVISION_CODES.put("6", "LCL06");
		LOCAL_DIVISION_CODES.put("7", "LCL07");
		
		String localDivisionCodeValue = "";
		
		if(localDivisionCode != null)
		{
			localDivisionCodeValue =  LOCAL_DIVISION_CODES.get(localDivisionCode);
		}
		
		return localDivisionCodeValue;
	}
	
	/**
	 * 본사의 규모에 대한 값을 반환한다.
	 * 
	 * @param consultingWayCode
	 * @return
	 */
	public String getHeadSizeCode(String headSizeCode)
	{
		HEAD_SIZE_CODES.put("BIZ01", "개인");
		HEAD_SIZE_CODES.put("BIZ02", "중소기업");
		HEAD_SIZE_CODES.put("BIZ03", "중견기업");
		HEAD_SIZE_CODES.put("BIZ04", "대기업");
		HEAD_SIZE_CODES.put("BIZ99", "기타");
		
		
		
		String headSizeCodeValue = "";
		
		if(headSizeCode != null)
		{
			headSizeCodeValue =  HEAD_SIZE_CODES.get(headSizeCode);
		}
		
		return headSizeCodeValue;
	}
	
	/**
	 * 본사규모 코드의 심플 코드를 반환한다.
	 * @param consultTypeCode
	 * @return
	 */
	public String getFromHeadSizeCodeToSimpleCode(String headSizeCode)
	{
		HEAD_SIZE_CODES.put("BIZ01", "1");
		HEAD_SIZE_CODES.put("BIZ02", "2");
		HEAD_SIZE_CODES.put("BIZ03", "3");
		HEAD_SIZE_CODES.put("BIZ04", "4");
		HEAD_SIZE_CODES.put("BIZ99", "5");
		
		
		String headSizeCodeValue = "";
		
		if(headSizeCode != null)
		{
			headSizeCodeValue =  HEAD_SIZE_CODES.get(headSizeCode);
		}
		
		return headSizeCodeValue;
	}
	
	/**
	 * 본사규모 심플코드의 원래 코드를 반환한다.
	 * @param consultTypeCode
	 * @return
	 */
	public String getFromSimpleCodeToHeadSizeCode(String headSizeCode)
	{
		HEAD_SIZE_CODES.put("1", "BIZ01");
		HEAD_SIZE_CODES.put("2", "BIZ02");
		HEAD_SIZE_CODES.put("3", "BIZ03");
		HEAD_SIZE_CODES.put("4", "BIZ04");
		HEAD_SIZE_CODES.put("5", "BIZ99");
		
		
		String headSizeCodeValue = "";
		
		if(headSizeCode != null)
		{
			headSizeCodeValue =  HEAD_SIZE_CODES.get(headSizeCode);
		}
		
		return headSizeCodeValue;
	}
	
	/**
	 * 상담경로 코드의 심플 코드를 반환한다.
	 * @param consultTypeCode
	 * @return
	 */
	public String getFromConsultingCodeValueToSimpleCode(String consultingCode)
	{
		CONSULTING_CODES.put("소개", "1");
		CONSULTING_CODES.put("홍보", "2");
		CONSULTING_CODES.put("본사", "3");
	
		
		
		String consultingCodeValue = "";
		
		if(consultingCode != null)
		{
			consultingCodeValue =  CONSULTING_CODES.get(consultingCode);
		}
		
		return consultingCodeValue;
	}
	
	/**
	 * 상담경로 코드의 원래 코드를 반환한다.
	 * @param consultTypeCode
	 * @return
	 */
	public String getFromSimpleCodeToConsultingCode(String consultingCode)
	{
		CONSULTING_CODES.put("1", "CON01");
		CONSULTING_CODES.put("2", "CON02");
		CONSULTING_CODES.put("3", "CON03");
	
		
		
		String consultingCodeValue = "";
		
		if(consultingCode != null)
		{
			consultingCodeValue =  CONSULTING_CODES.get(consultingCode);
		}
		
		return consultingCodeValue;
	}
	
	/**
	 * 전담유무 플래그 코드의 심플 코드를 반환한다.
	 * @param consultTypeCode
	 * @return
	 */
	public String getFromExclusiveFlagCodeValueToSimpleCode(String exclusiveFlagCode)
	{
		EXCLUSIVE_FLAG_CODES.put("전담", "1");
		EXCLUSIVE_FLAG_CODES.put("겸직", "2");
		
		
		String exclusiveFlagCodeValue = "";
		
		if(exclusiveFlagCode != null)
		{
			exclusiveFlagCodeValue =  EXCLUSIVE_FLAG_CODES.get(exclusiveFlagCode);
		}
		
		return exclusiveFlagCodeValue;
	}
	
	/**
	 * 전담유무 플래그 심플코드의 원래코드를 반환한다.
	 * @param consultTypeCode
	 * @return
	 */
	public String getFromSimpleCodeToExclusiveFlagCode(String exclusiveFlagCode)
	{
		EXCLUSIVE_FLAG_CODES.put("1", "Y");
		EXCLUSIVE_FLAG_CODES.put("2", "N");
		
		
		String exclusiveFlagCodeValue = "";
		
		if(exclusiveFlagCode != null)
		{
			exclusiveFlagCodeValue =  EXCLUSIVE_FLAG_CODES.get(exclusiveFlagCode);
		}
		
		return exclusiveFlagCodeValue;
	}
}
